<div id="{$divName}">
  <a id="viewMod{$divName}" href="javascript:void(0);" onclick="avanced()">{ldelim}i18n locale="f_locale_Manager.avanced"{rdelim}</a>
  <table id="{$divName}Tab" border="1">
    <thead>
    <tr>
{foreach from=$th item=t}
      <th>{ldelim}i18n locale="{$t.label}"{rdelim}</th>
{/foreach}
      <th>{ldelim}i18n locale="$key.locale.supprimer"{rdelim}</th>
    </tr>
    </thead>
{ldelim}foreach from=$data item=value{rdelim}
    <tr id="row_{ldelim}$value->getUniqueId(){rdelim}">
{$fields}
      <td>
        <a href="javascript:void(0);" onclick="deleteObject('{$documentName}|{ldelim}$value->getUniqueId(){rdelim}','{ldelim}$value->getUniqueId(){rdelim}')">
          {ldelim}icon name="garbage_empty.png"{rdelim}
        </a>
      </td>
    </tr>
{ldelim}/foreach{rdelim}  
  </table>
</div>
{ldelim}literal{rdelim}
<script>
	var tmp = document.getElementById('{$divName}').innerHTML;
	
	function normal()
	{ldelim}
		document.getElementById('{$divName}').innerHTML = tmp;
		
		$('#{$divName}Tab').dataTable({ldelim}
        	"bPaginate": {if isset($listOptions.pagination) }{$listOptions.pagination},{else}false,{/if}
			"bSort": {if isset($listOptions.filter) }{$listOptions.filter},{else}false,{/if}  
        	"bFilter": {if isset($listOptions.sort) }{$listOptions.sort},{else}false,{/if}
        	"bInfo": false,
        	"aoData": [ 
{foreach from=$th item=column1}
				/* {ldelim}/literal{rdelim}{ldelim}i18n locale="{$column1.label}"{rdelim}{ldelim}literal{rdelim} */ {if $column1.show == true}null,{else}{ldelim}"bVisible": false{rdelim},{/if}
{/foreach}
				/* {ldelim}/literal{rdelim}{ldelim}i18n locale="$key.locale.supprimer"{rdelim}{ldelim}literal{rdelim} */ null    
			]    	    
		{rdelim});
		
		var viewMod = document.getElementById('viewMod{$divName}');
		viewMod.setAttribute('onclick','avanced()');
		viewMod.innerHTML = '{ldelim}/literal{rdelim}{ldelim}i18n locale="f_locale_Manager.avanced"{rdelim}{ldelim}literal{rdelim}';
	{rdelim}
	
	function avanced()
	{ldelim}
		document.getElementById('{$divName}').innerHTML = tmp;
		$('#{$divName}Tab').dataTable({ldelim}
	        "bPaginate": true,		
	        "bSort": true,  
	        "bFilter": true,
	        "bInfo": true,
	        "aoData": [ 
{foreach from=$th item=column2}
      			/* {ldelim}/literal{rdelim}{ldelim}i18n locale="{$column2.label}"{rdelim}{ldelim}literal{rdelim} */ null,
{/foreach}
				/* {ldelim}/literal{rdelim}{ldelim}i18n locale="$key.locale.supprimer"{rdelim}{ldelim}literal{rdelim} */ null
			]	         
		{rdelim});
		
		var viewMod = document.getElementById('viewMod{$divName}');
		viewMod.setAttribute('onclick','normal()');
		viewMod.innerHTML = '{ldelim}/literal{rdelim}{ldelim}i18n locale="f_locale_Manager.normal"{rdelim}{ldelim}literal{rdelim}';	
	{rdelim}
			
	$('#{$divName}Tab').dataTable({ldelim}
        "bPaginate": {if isset($listOptions.pagination) }{$listOptions.pagination},{else}false,{/if}
		"bSort": {if isset($listOptions.filter) }{$listOptions.filter},{else}false,{/if}  
        "bFilter": {if isset($listOptions.sort) }{$listOptions.sort},{else}false,{/if}
        "bInfo": false,
		"aoData": [ 
{foreach from=$th item=column3}
     		/* {ldelim}/literal{rdelim}{ldelim}i18n locale="{$column3.label}"{rdelim}{ldelim}literal{rdelim} */ {if $column3.show == true}null,{else}{ldelim}"bVisible": false{rdelim},{/if}
{/foreach}
			/* {ldelim}/literal{rdelim}{ldelim}i18n locale="$key.locale.supprimer"{rdelim}{ldelim}literal{rdelim} */ null
		]           
	{rdelim});
</script>
{ldelim}/literal{rdelim}